import { lazy } from "react";
import { RouterItem, RouterList } from '../util/type'
import lodable from '../util/lodable'
var childRouter: RouterItem[] = [
    {
        path:"/home/classfy",
        to:"/home/classfy/game"
    },
    {
        path: "/home/cart",
        element: lodable(() => { return import('../page/mycart/Inddex') })
    },
    {
        path: "/home/classfy",
        element: lodable(() => { return import('../page/classfy/Index') }),
        children: [
            {
                path: "/home/classfy/game",
                element: lodable(() => { return import('../page/classfy/game/Index') })
            },
             {
                path: "/home/classfy/music",
                element: lodable(() => { return import('../page/classfy/music/Index') })
            },
        ]
    },
    {
        path: "/home/index",
        element: lodable(() => { return import('../page/Index/index') })
    },
]
var routes: RouterList =
{
    mode: 'history',
    route: [
        {
            path: "/",
            to: "/home/index",

        },
        {
            path: "/home",
            element: lodable(() => { return import('../page/home/Index') }),
            children: childRouter
        },
        {
            path: "/login",
            element: lodable(() => { return import('../page/login/Index') })
        },
        {
            path: "*",
            element: lodable(() => { return import('../page/error/Index') })
        }
    ]
}


export default routes
// import { lazy } from "react"
// import { RouterItem, RouterList } from "../util/type"
// var aa:RouterItem[]=[
//         {
//             path: '/',
//             to: '/home/index'
//         },
//         {
//             path: '/home',
//             element: lazy(() => import('../page/home/Index')),
//             children: [
//                 {
//                     path: '/home/index',
//                     element: lazy(() => import('../page/home/Index')),
//                     children: [
//                         {
//                             path: '/home/index/get',
//                             element: lazy(() => import('../page/index/get/Index')),
//                         }
//                     ]
//                 },
//                 {
//                     path: '/home/cart',
//                     element: lazy(() => import('../page/cart/Indedx')),
//                 }
//             ]
//         },
//         {
//             path: '/login',
//             element: lazy(() => import('../page/login/Index'))
//         },
//         {
//             path: '*',
//             element: lazy(() => import('../page/error/Index'))
//         }
//     ]

// const router:RouterList = {
//     mode: 'history',
//     route: aa
// }
// export default router